package com.ellwood.common.core.enums;

import lombok.Getter;

/**
 * @ProjectName: Ellwood-framework-boot
 * @PackageName: com.ellwood.common.core.enums
 * @ClassName: HttpCodeEnum
 * @Description: // TODO
 * @Author: Ellwood
 * @CreateDate: 2024/7/13 - 上午1:03
 * @Version: V1.0.0
 */
@Getter
public enum HttpCodeEnum {
    // 成功
    SUCCESS(200, "操作成功"),
    ERROR(400, "请求失败"),
    // 登录
    NEED_LOGIN(401, "请先登录"),
    NO_OPERATOR_AUTH(403, "无权限操作"),
    QUERY_DATA_NULL(404, "查询数据为空"),
    QUERY_DATA_NOT_EXIST(405, "查询数据不存在"),

    SYSTEM_ERROR(500, "出现错误"),

    USERNAME_EXIST(501, "用户名已存在"),
    PHONE_NUMBER_EXIST(502, "手机号已存在"),
    EMAIL_EXIST(503, "邮箱已存在"),
    REQUIRE_USERNAME(504, "必需填写用户名"),
    CONTENT_NOT_NULL(506, "评论内容不能为空"),
    FILE_TYPE_ERROR(507, "文件类型错误"),
    USERNAME_NOT_NULL(508, "用户名不能为空"),
    NICKNAME_NOT_NULL(509, "昵称不能为空"),
    PASSWORD_NOT_NULL(510, "密码不能为空"),
    EMAIL_NOT_NULL(511, "邮箱不能为空"),
    NICKNAME_EXIST(512, "昵称已存在"),
    BAD_REQUEST(513, "请求参数错误");

    private Integer code;
    private String msg;

    HttpCodeEnum(Integer code, String errorMessage) {
        this.code = code;
        this.msg = errorMessage;
    }
}
